/*
 * Logger.h
 *
 *  Created on: Jun 3, 2011
 *      Author: madboyka
 */

#ifndef LOGGER_H_
#define LOGGER_H_
#include <stdarg.h>
#include <QString>

enum LogLevel
{
	UnknownLog, DebugLog, WarningLog, CriticalLog
};

/*!
 * Static logger class that displays log information on the console and saves it to files.
 */
class Logger
{
	static QString filename;
	static bool initialized;
public:
	/*!
	 * Initialized the logger, setting the log files name to it.
	 */
	static void init(QString);
	/*!
	 * Logs a message with the given format and loglevel, variable arguments list.
	 */
	static void log(LogLevel,QString,va_list);
	/*!
	 * Logs a message with the given format and loglevel, variable arguments list.
	 */
	static void log(LogLevel,const char*,va_list);
	/*!
	 * Logs a message with the given format and unknown loglevel, variable arguments list.
	 */
	static void log(QString,...);
	/*!
	 * Logs a message with the given format and unknown loglevel, variable arguments list.
	 */
	static void log(const char*,...);
	/*!
	 * Logs a message with the given format and debug loglevel, variable arguments list.
	 */
	static void debug(QString,...);
	/*!
	 * Logs a message with the given format and warning loglevel, variable arguments list.
	 */
	static void warning(QString,...);
	/*!
	 * Logs a message with the given format and error loglevel, variable arguments list.
	 */
	static void error(QString,...);
	/*!
	 * Logs a 4 by 4 matrix, variable arguments list.
	 */
	static void logMatrix(float*);
};

#endif /* LOGGER_H_ */
